<% title _("Architectures") %>
<% title_actions new_link(_("Create Architecture")), help_button %>

<table class="<%= table_css_classes 'table-fixed' %>">
  <thead>
    <tr>
      <th class="col-md-4"><%= sort :name, :as => s_("Architecture|Name") %></th>
      <th><%= _("Operating Systems") %></th>
      <th class="col-md-1"><%= _("Hosts") %></th>
      <th class="col-md-1"><%= _('Actions') %></th>
    </tr>
  </thead>
  <tbody>
  <% for architecture in @architectures %>
    <tr>
      <td class='ellipsis'><%= link_to_if_authorized(architecture.name,
                                                     hash_for_edit_architecture_path(:id => architecture).merge(:auth_object => architecture, :authorizer => authorizer)) %></td>
      <td class="ellipsis"><%= architecture.operatingsystems.map(&:to_label).to_sentence %></td>
      <td><%= link_to hosts_count[architecture], current_hosts_path(:search => "architecture = #{architecture}") %>
      <td>
        <%= action_buttons(display_delete_if_authorized hash_for_architecture_path(:id => architecture).merge(:auth_object => architecture, :authorizer => authorizer),
          :data => { :confirm => _("Delete %s?") % architecture.name } ) %>
      </td>
    </tr>
  <% end %>
  </tbody>
</table>
<%= will_paginate_with_info @architectures %>
